package com.meichis.mcsappframework.photoview;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

/**
 * Created by pei on 2016/10/26.
 */

public class ImagePagerAdapter extends FragmentStatePagerAdapter {
    private String[] imagePaths;

    public ImagePagerAdapter(FragmentManager fm, String[] imagePaths) {
        super(fm);
        this.imagePaths = imagePaths;
    }

    @Override
    public Fragment getItem(int position) {
        return ImageDetailFragment.newInstance(imagePaths[position]);
    }

    @Override
    public int getCount() {
        return imagePaths.length;
    }
}
